<a href='http://github.com/angular/angular.js/edit/master/src/ngMock/angular-mocks.js' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this doc</a>



<a href='http://github.com/angular/angular.js/tree/master/src/ngMock/angular-mocks.js#L1614' class='view-source pull-right btn btn-primary'>
  <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source
</a>


<header class="api-profile-header">
  <h1 class="api-profile-header-heading">$timeout</h1>
  <ol class="api-profile-header-structure naked-list step-list">
    
  

    <li>
      - service in module <a href="api/ngMock">ngMock</a>
    </li>
  </ol>
</header>



<div class="api-profile-description">
  <p>This service is just a simple decorator for <a href="api/ng/service/$timeout">$timeout</a> service
that adds a &quot;flush&quot; and &quot;verifyNoPendingTasks&quot; methods.</p>

</div>




<div>
  

    

  

  
<h2>Methods</h2>
<ul class="methods">
  <li id="flush">
    <h3><p><code>flush([delay]);</code></p>

</h3>
    <div><p>Flushes the queue of pending tasks.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        delay
        
        <div><em>(optional)</em></div>
      </td>
      <td>
        <a href="" class="label type-hint type-hint-number">number</a>
      </td>
      <td>
        <p>maximum timeout amount to flush up until</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    

  </li>
  
  <li id="verifyNoPendingTasks">
    <h3><p><code>verifyNoPendingTasks();</code></p>

</h3>
    <div><p>Verifies that there are no pending tasks that need to be flushed.</p>
</div>

    

    
    
    

  </li>
  </ul>
  
  



  
</div>


